@page "/Range_Bar_Chart"

<Bar Data=data1.Reverse() Config="config1" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <Bar @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }

    #region 示例1

    object[] data1 = new object[] {
        new  { type= "分类一", values=new int []{76, 100 } },
        new  { type= "分类二", values=new int []{56, 108 } },
        new  { type= "分类三", values=new int []{38, 129 } },
        new  { type= "分类四", values=new int []{58, 155 } },
        new  { type= "分类五", values=new int []{45, 120 } },
        new  { type= "分类六", values=new int []{23, 99 } },
        new  { type= "分类七", values=new int []{18, 56 } },
        new  { type= "分类八", values=new int []{18, 34 } },
};

    BarConfig config1 = new BarConfig()
    {
        XField = "values",
        YField = "type",
        IsRange = true,
        Label = new BarViewConfigLabel()
        {
            Position = "middle",
            Layout = new []
            {
                new LayoutType()
                {
                    Type = "adjust-color"
                }
            }
        }
    };

    #endregion 示例1

}

